import { useRequest, defaultFormatResult } from '@/hooks';
import { getRecruitOutwardsChannelDetail } from '../../service';

export default function useRecruitOutwardsChannelDetail(outwardId, code) {
    const { data, loading } = useRequest(
        () => {
            if (outwardId && code) {
                return getRecruitOutwardsChannelDetail(code, outwardId);
            }
            return null;
        },
        {
            refreshDeps: [outwardId, code],
            ...defaultFormatResult
        }
    );
    return [data, loading];
}
